const mongoose = require("mongoose");

const cinemasModel = mongoose.model("cinemas");

//电影信息接口
// wtf
module.exports = {
    //获取电影详情信息
    get: async () => {
        const data = await cinemasModel.find();//获取所有数据
        return data;
    },
    getOne: async ({ _id }) => await cinemasModel.findOne({ _id }),
    getAll: async () => await cinemasModel.find(),
    add: async (data) => { cinemasModel.create(data); },
    update: async (conditions, doc) => { return await cinemasModel.updateOne(conditions, doc) },
    remove: async ({ _id }) => await cinemasModel.deleteOne({ _id })

}